﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Theme_DL_UserControls_Message : System.Web.UI.UserControl
{
    PowerCreator.LMS.Web.CMS.New opNews = new PowerCreator.LMS.Web.CMS.New();
    protected void Page_Load(object sender, EventArgs e)
    {
        BinderNews();
    }
    private void BinderNews()
    {
        string search = " NewState = 1 and ((FKNewTrainclaIDList is null) or (FKNewTrainclaIDList='')) and NewID not in (select top 5 NewID from Tnew where NewPictureUrl is not null and NewState = 1 and ((FKNewTrainclaIDList is null) or (FKNewTrainclaIDList='')) order by NewPublishTime desc)";
        string orderBy = " NewPublishTime desc ";
        DataTable dt = opNews.Query(search, orderBy, 8, 1);
        rpt_News.DataSource = dt;
        rpt_News.DataBind();
    }
}
